<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"

      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./TemplatePrincipal.xhtml">

            <ui:define name="top">
                <h:form>
                    <p:tabMenu id="menu" activeIndex="2" >  
                        <p:menuitem value="Home" action="index" />  
                        <p:menuitem value="Users" action="UserFacelets"/>  
                        <p:menuitem value="TypeClass" action="TypeClassFacelets" /> 
                        <p:menuitem value="Profiles" action="ProfileFacelets" />
                        <p:menuitem value="Services" action="ServiceFacelets" />
                        <p:menuitem value="Terrains" action="TerrainFacelets" />
                    </p:tabMenu> 
                </h:form>  
            </ui:define>

            <ui:define name="left">
                left
            </ui:define>

            <ui:define name="content">
                <f:view>
                    <h:form id="formType">

                        <p:contextMenu for="typeClass">  
                            <p:menuitem value="Edit"  icon="ui-icon-search" action="TypeClassCrearEditar" 
                                        actionListener="#{typeClassBean.prepararEditar}"/>
                            <p:menuitem value="Delete" update="formType" icon="ui-icon-close" actionListener="#{typeClassBean.eliminar}"/> 
                        </p:contextMenu>


                        <p:commandButton value="Nuevo" action="#{typeClassBean.prepararNuevo()}" />
                        <p:dataTable id="typeClass" value="#{typeClassBean.typeclasss}" var="item" widgetVar="typeVar" rowKey="#{item.type}"
                                     selectionMode="single" emptyMessage="No TypeClass found with given criteria"
                                     filteredValue="#{typeClassBean.filteredClass}" selection="#{typeClassBean.typeclass}">

                            <f:facet name="header">  
                                <p:outputPanel>  
                                    <h:outputText value="Search all fields:" />  
                                    <p:inputText id="globalFilter" onkeyup="typeVar.filter()" style="width:150px" />  
                                </p:outputPanel>  
                            </f:facet> 

                            <p:column filterStyle="display:none" filterBy="#{item.type}">
                                <f:facet name="header">
                                    <p:outputLabel value="Type"/>
                                </f:facet>
                                <p:outputLabel value="#{item.type}"/>
                            </p:column>
                            <p:column filterStyle="display:none" filterBy="#{item.mount}">
                                <f:facet name="header">
                                    <p:outputLabel value="Mount"/>
                                </f:facet>
                                <p:outputLabel value="#{item.mount}"/>
                            </p:column>
                        </p:dataTable>
                    </h:form>
                </f:view>

            </ui:define>

            <ui:define name="bottom">
                bottom
            </ui:define>

        </ui:composition>

    </body>
</html>
